'use strict';

/**
 * @ngdoc function
 * @name openshiftConsole.controller:StorageController
 * @description
 * # StorageController
 * Controller of the openshiftConsole
 */
angular.module('openshiftConsole')
  .controller('UserOplogController', function ($routeParams, $scope, AuthService, AlertMessageService, DataService, MyDataService) {
    $scope.projectName = $routeParams.project;
    $scope.logs = {};
    $scope.emptyMessage = "Loading...";

    var username = AuthService.UserStore().getUser().metadata.name;
    // get and clear any alerts
    AlertMessageService.getAlerts().forEach(function(alert) {
      $scope.alerts[alert.name] = alert.data;
    });
    AlertMessageService.clearAlerts();
    //var watches = [];

    AuthService.withUser().then(function() {
      //watches.push(DataService.watch("projects", $scope, function(projects) {
      //
      //  $scope.projects = projects.by("metadata.name");
      //  $scope.showGetStarted = hashSizeFilter($scope.projects) === 0;
      //}));
      MyDataService.setLog(username,'detailmyhah23x','1');
      MyDataService.getLog(username).then(function(logs){
        $scope.logs = logs;
      });
    });

  });
